import ListItem from "../../../components/ListItem";
import ResManager from "../../../core/ResManager";
import { ResType } from "../../../net/Commond";
import { BattleTest } from "../../data/BattleTest";
import { ResPath } from "../../data/CFCommon";

const { ccclass, property } = cc._decorator;

@ccclass
export default class ItemHeroIcon extends ListItem {

    init(heroId: number) {
        let heroData = BattleTest.ins().getHeroConfigData(heroId);
        if (heroData) {
            ResManager.ins().loadSingle(heroData.heroIcon, ResType.image, ResPath.heroicon, (asset) => {
                this.icon.spriteFrame = asset;
            }, this.node);
        }
    }
}